<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Video & Audio Test</title>
  <style>
    .audio {
      position: fixed;
      top: 20px; right: 20px;
      width: 40px; height: 40px;
      border: 1px solid #0f0;
      background-color: #0f0;
      transition: background-color .2s;
      z-index: 2;
    }
    .audio:hover {
      border-color: #f00;
    }
    .audio.active {
      background-color: #f00;
      border-color: #f00;
    }
    .btn-video {
      position: fixed;
      top: 20px;
      z-index: 2;
    }
    .videoCon video {
      max-width: 100%;
      z-index: 1;
    }
  </style>
</head>
<body>
  <div class="audio" id="yeMusic">
    <audio src="https://ccstatic-1252317822.file.myqcloud.com/assets/5f1b65a0-49a3-11eb-ae7e-35e769c43667.mp3" id="actAudio"></audio>
  </div>
  <button class="btn-video" id="playVideo">播放视频</button>
  <div class="videoCon">
    <video id="videoFisrt" webkit-playsinline="true" playsinline="true" x5-video-player-type="h5" muted src="https://imgservices-1252317822.file.myqcloud.com/file/20201216/yl8mcsjqfs.mp4"></video>
  </div>
  <script src="howler.min.js"></script>
  <script>
    document.querySelector("#playVideo").addEventListener('click', function() {
      document.querySelector('#videoFisrt').play()
    })
    
    var myMusic = document.querySelector('#yeMusic');
    var actAudio = document.querySelector('#actAudio');
    myMusic.addEventListener('click', function() {
      if(myMusic.classList.contains('active')) {
        actAudio.pause();
        myMusic.classList.remove('active');
      } else {
        actAudio.play();
        myMusic.classList.add('active');
      }
    });
  </script>
</body>
</html>